<?php

namespace App\Http\Responses\Admin;

use Illuminate\Contracts\Support\Responsable;

class InfoResponse implements Responsable
{
    protected $result;

    public function __construct(array $result)
    {
        $this->result = $result;
    }

    public function toResponse($request)
    {
        return response_api($this->transform());
    }

    protected function transform()
    {
        return [
            'admin'       => $this->result['admin'],
            'permissions' => $this->result['permissions'],
            'menus'       => $this->result['menus'],
        ];
    }
}